/**
 * 
 */
package models.admin;

import java.util.Collections;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.OneToMany;

import org.hibernate.envers.Audited;

import play.db.jpa.Model;

/**
 * @author rjanixz
 *
 */
@Entity
@Audited
public class Module extends Model {

	@Column(unique=true, nullable=false)
	private String name;
	private String description;
	@OneToMany(mappedBy="module")
	private List<Page> pages;
	
	public String getName() {
		return name;
	}
	
	public void setName(String name) {
		this.name = name;
	}
	
	public String getDescription() {
		return description;
	}
	
	public void setDescription(String description) {
		this.description = description;
	}
	
	public List<Page> getPages() {
		if (pages == null) {
			pages = Collections.<Page>emptyList();
		}
		return pages;
	}
	
	public void setPages(List<Page> pages) {
		this.pages = pages;
	}
	
}
